package cn.tedu.store.service;

import java.util.List;

import cn.tedu.store.entity.Address;
import cn.tedu.store.service.ex.AccessDeniedException;
import cn.tedu.store.service.ex.AddressLimitExceededException;
import cn.tedu.store.service.ex.AddressNotFoundException;
import cn.tedu.store.service.ex.DeleteException;
import cn.tedu.store.service.ex.InsertException;
import cn.tedu.store.service.ex.UpdateException;
/**
 * 收货地址接口
 * @author Administrator
 *
 */
public interface IAddressService {
	/**
	 * 创建收货地址数据
	 * @param address
	 * @param username
	 * @throws AddressLimitExceededException
	 * @throws InsertException
	 */
	void createAddress(Address address,String username) throws AddressLimitExceededException,InsertException;

	/**
	 * 查询某用户的收货地址列表
	 * @param uid
	 * @return
	 */
	List<Address> getByUid(Integer uid);
	
	Address getByAid(Integer aid);

	
	/*
	 * 设置默认地址
	 */
	void setDefault(Integer aid,Integer uid,String username) 
			throws AddressNotFoundException,AccessDeniedException,UpdateException;


	/*删除默认地址*/
	void delete(Integer aid,Integer uid,String username) throws AddressNotFoundException,AccessDeniedException,DeleteException,UpdateException;


}
